package com.jyy.prefabricated.service;

import com.jyy.prefabricated.dto.ChangePwdDto;
import com.jyy.prefabricated.dto.StudentsOfficialDto;
import com.jyy.prefabricated.dto.SysUserDto;
import com.jyy.prefabricated.dto.UserRoleDto;
import com.jyy.prefabricated.entity.*;
import com.jyy.prefabricated.enums.BaseStatusEnum;
import com.jyy.prefabricated.enums.UserTypeEnum;
import com.jyy.prefabricated.exception.CustomException;
import com.jyy.prefabricated.mapper.*;
import com.jyy.prefabricated.utils.UserUtils;
import com.jyy.prefabricated.vo.StudentsOfficialVo;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @version 1.0.0
 * @author: zjj
 */

@Service
public class SysTeamService {

    @Autowired
    private SysTeamMapper teanMapper;

    public int update(SysTeam dto) {
        if (dto.getTeamCode() == null || "".equals(dto.getTeamCode())) {
            throw new CustomException("租户编码不能为空");
        }

        return teanMapper.updateByTeamCode(dto);
    }
    /**
     * 查询
     *
     * @return
     */
    public List<SysTeam> selectByParams(SysTeam dto) {
        return teanMapper.selectAll(dto);
    }
}
